<template>
	<view class="content">
		<button class="size" @tap="addEventListener">添加推送消息事件监听器</button>
		<button class="size" @tap="clear">清空所有推送消息</button>
		<button class="size" @tap="createMessage">创建本地消息</button>
		<button class="size" @tap="getAllMessage">获取所有推送消息</button>
		<button class="size" @tap="getClientInfo">获取客户端推送标识信息</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				watchId: null
			}
		},
		onLoad() {

		},
		methods: {
			addEventListener() {
				plus.push.addEventListener('click', function(msg) {
					console.log('You clicked: ' + msg.content);
				}, false);
			},
			clear() {
				plus.push.clear()
			},
			createMessage() {
				plus.push.createMessage( "我是消息推送内容")
			},
			getAllMessage(){
				const info = plus.push.getAllMessage();
				console.log("info=>",info)
			},
			getClientInfo(){
				const info = plus.push.getClientInfo();
				console.log("info=>",info)
			}
			
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}

	.size {
		margin: 30rpx 0;
	}
</style>
